let canvas;
let canvasForCreate;
let stage;
let txt;
window.onload = function () {
    /*
    普通例子
     */
    canvas = document.getElementById("canvas");
    let paint = canvas.getContext("2d");
    paint.fillStyle = "#ff00ff";
    paint.fillRect(20, 20, 100, 100)

    /*
    createjs例子
     */
    canvasForCreate = document.getElementById("canvasForCreate")
    stage = new createjs.Stage(canvasForCreate);
    txt = new createjs.Text("数字", "30px 楷体", "#33ffaa")
    stage.addChild(txt);
    createjs.Ticker.setFPS(2);
    createjs.Ticker.addEventListener("tick", tick)

}
let count = 0;

function tick(e) {
    txt.text = "数字" + count;
    count++;
    stage.update();
}
